import { Pipe, PipeTransform } from '@angular/core';
import {Config} from '../config';
import * as moment from 'moment';

@Pipe({name: 'timeTrans'})
export class TimePipe implements PipeTransform {
    transform(value){
        if(!value){
            return null;
        }
        let values = value+'';
        let date = values.substring(0,8);
        let time = values.substring(8,14);
        let dates = moment(date).format('YYYY-MM-DD');
        let times = time.substring(0,2)+':'+time.substring(2,4)+':'+time.substring(4,6);
        
        return dates+' '+times;
    }
}